import request from 'src/axios'

/**
 * @description 分页查询仓库信息列表
 * @param { Object } params 查询参数
 * @returns Promise
 */
export const pageWarehouseInfo = (params: object) => {
  return request.get('/wms/warehouseInfo/page', { params })
}

/**
 * @description 查询所有仓库信息
 * @param { Object } params 查询参数
 * @returns Promise
 */
export const listWarehouseInfo = (params?: object) => {
  return request.get('/wms/warehouseInfo/list', { params })
}

/**
 * @description 查看仓库信息信息
 * @param { String } id 主键
 * @returns Promise
 */
export const viewWarehouseInfo = (id: string) => {
  return request.get('/wms/warehouseInfo', { params: { id } })
}

/**
 * @description 新增仓库信息
 * @param { Object } data 新增数据
 * @returns Promise
 */
export const saveWarehouseInfo = (data: object) => {
  return request.post('/wms/warehouseInfo', data)
}

/**
 * @description 修改仓库信息
 * @param { Object } data 修改数据
 * @returns Promise
 */
export const updateWarehouseInfo = (data: object) => {
  return request.put('/wms/warehouseInfo', data)
}

/**
 * @description 删除仓库信息
 * @param { Array<string> } ids 主键数组
 * @returns Promise
 */
export const deleteWarehouseInfo = (ids: Array<string>) => {
  return request.delete('/wms/warehouseInfo', { data: ids })
}

/**
 * @description 启用仓库信息
 * @param { String } id 主键
 * @returns Promise
 */
export const enableWarehouseInfo = (id: string) => {
  return request.put('/wms/warehouseInfo/enable', { id })
}

/**
 * @description 禁用仓库信息
 * @param { String } id 主键
 * @returns Promise
 */
export const disableWarehouseInfo = (id: string) => {
  return request.put('/wms/warehouseInfo/disable', { id })
}
